package com.kesh.ltank.elements;

import android.graphics.Point;

import com.kesh.ltank.game.GlobalVars;
import com.kesh.ltank.game.GlobalVars.AntiTankState;
import com.kesh.ltank.game.GlobalVars.BulletState;
import com.kesh.ltank.game.GlobalVars.Direction;
import com.kesh.ltank.game.GlobalVars.FirePathState;
import com.kesh.ltank.game.GlobalVars.GameSounds;
import com.kesh.ltank.game.GlobalVars.PlayObjects;
import com.kesh.ltank.game.GlobalVars.TankState;
import com.kesh.ltank.game.Utils;

public class LTank {
	
	private Point curTankPos;
	private Direction curTankDirection;
	private Bullet curTankBullet;
	private PlayObjects[][] lvlBaseField;
	private PlayObjects[][] lvlPlayField;
	
	private TankState curTankState;
	private TankState storedTankState;
	private int tankStateTime;
	
	private ATank aTankPrev;
	private ATank aTankCur;
	
	private int tankMoves;
	private int tankShots;
	
	private int stateChangeCount;

	public LTank(){} ;

	public LTank(Level inLvl) {
		lvlPlayField= inLvl.getLvlPlayField();
		lvlBaseField= inLvl.getLvlBaseField();
		curTankPos = inLvl.getTankOrigPos();
		curTankDirection = Direction.Up;
		curTankState = TankState.Moving;
		tankStateTime=0;
		curTankBullet = new Bullet();
		aTankPrev = new ATank();
		aTankCur = new ATank();
		storedTankState=TankState.Moving;
		tankMoves=0;
		tankShots=0;
		stateChangeCount=0;
	}
	
	public LTank clone(){
		LTank newLTank=new LTank();
		newLTank.curTankDirection = curTankDirection;
		newLTank.curTankPos = curTankPos;
		newLTank.curTankState = curTankState;

		newLTank.lvlBaseField = new PlayObjects[GlobalVars.lvlFieldLen.x][GlobalVars.lvlFieldLen.y];
		newLTank.lvlPlayField = new PlayObjects[GlobalVars.lvlFieldLen.x][GlobalVars.lvlFieldLen.y];
		
		for (int x = 0; x < GlobalVars.lvlFieldLen.x; x++) {
			for (int y = 0; y < GlobalVars.lvlFieldLen.y; y++) {
				newLTank.lvlBaseField[x][y] = lvlBaseField[x][y];
				newLTank.lvlPlayField[x][y] = lvlPlayField[x][y];
			}
		}

		
		newLTank.storedTankState = storedTankState;
		newLTank.tankMoves = tankMoves;
		newLTank.tankShots = tankShots;
		newLTank.tankStateTime = tankStateTime;
		newLTank.aTankCur = aTankCur.clone();
		newLTank.aTankPrev = aTankPrev.clone();
		newLTank.curTankBullet = curTankBullet.clone();
		return newLTank;
	}

	public boolean turnTank(Direction turnDirection){
		boolean turnTank = false;
		PlayObjects curTankObj = lvlPlayField[curTankPos.x][curTankPos.y];
		PlayObjects nxtTankObj = Utils.turnTank(turnDirection);
		switch (turnDirection) {
			case Up: turnTank=curTankObj!=PlayObjects.LTank_U;break;
			case Right: turnTank=curTankObj!=PlayObjects.LTank_R;break;
			case Down: turnTank=curTankObj!=PlayObjects.LTank_D;break;
			case Left: turnTank=curTankObj!=PlayObjects.LTank_L;break;
		}
		
		if(turnTank) {
			curTankDirection = turnDirection;
			lvlPlayField[curTankPos.x][curTankPos.y]=nxtTankObj;
		}
		return turnTank;
	}

	public boolean moveTank(Direction moveDirection) {
		boolean isMoved = false;
		if (tankStateTime > 0) {
			tankStateTime--;
		} else {
			
			boolean stateChanged=false;
			TankState tmpTankState = TankState.Moving;
			if(curTankState==TankState.OnStream){
				if(isPosOnFire(aTankPrev, curTankPos)){
					tmpTankState=TankState.PrevATankFired;
				}
			}

			PlayObjects curBaseObj = lvlBaseField[curTankPos.x][curTankPos.y];
			PlayObjects curTankObj = lvlPlayField[curTankPos.x][curTankPos.y];
			TankState nxtTankState = curTankState;
			Point nxtTankPos = curTankPos;

			if (curTankState == TankState.OnTunnel) {
				nxtTankPos = getTargetTunnelLocation(curBaseObj, curTankPos);
				lvlPlayField[curTankPos.x][curTankPos.y] = curBaseObj;
				lvlPlayField[nxtTankPos.x][nxtTankPos.y] = curTankObj;
				tankStateTime = 0;
				nxtTankState = TankState.Moving;
				curTankPos = nxtTankPos;
			} else if (!turnTank(moveDirection)) {

				if (curTankState == TankState.OnStream) {
					moveDirection = Utils.getDirection(curBaseObj);
				}

				nxtTankPos = Utils.getNextPosition(curTankPos, moveDirection);

				if (Utils.positionWithinBounds(nxtTankPos)) {
					PlayObjects nxtPosObj = lvlPlayField[nxtTankPos.x][nxtTankPos.y];
					if (!GlobalVars.fixedObjects.contains(nxtPosObj)) {
						lvlPlayField[curTankPos.x][curTankPos.y] = curBaseObj;
						lvlPlayField[nxtTankPos.x][nxtTankPos.y] = curTankObj;

						if (GlobalVars.tunnelObjects.contains(nxtPosObj)) {
							tankStateTime = 4;
							stateChanged=true;
							nxtTankState = TankState.OnTunnel;
						} else if (GlobalVars.streamObjects.contains(nxtPosObj)) {
							tankStateTime = 0;
							nxtTankState = TankState.OnStream;
						} else if (nxtPosObj == PlayObjects.Ice) {
							tankStateTime = 2;
							nxtTankState = TankState.OnIce;
						} else if (nxtPosObj == PlayObjects.ThinIce) {
							lvlBaseField[nxtTankPos.x][nxtTankPos.y] = PlayObjects.Water;
						} else if (nxtPosObj == PlayObjects.Water) {
							tankStateTime = 0;
							nxtTankState = TankState.OnWater;
							stateChanged=true;
						} else if (nxtPosObj == PlayObjects.Flag) {
							tankStateTime = 0;
							nxtTankState = TankState.ReachedFlag;
							stateChanged=true;
						} else {
							tankStateTime = 0;
							nxtTankState = TankState.Moving;
							stateChanged=true;
						}

						curTankPos = nxtTankPos;
						isMoved = true;
					} else {
						tankStateTime = 0;
						nxtTankState = TankState.Blocked;
					}
				}
			}
			
			
			if(nxtTankState!=TankState.OnStream && nxtTankState!=TankState.Blocked){
				if(isPosOnFire(aTankCur, curTankPos)){
					if(tmpTankState==TankState.PrevATankFired)
						nxtTankState=TankState.BothATankFired;
					else
						nxtTankState=TankState.CurATankFired;
				}
			}
			if(tmpTankState==TankState.PrevATankFired){
				if(nxtTankState==TankState.Blocked){
					aTankCur=aTankPrev;
					nxtTankState=TankState.CurATankFired;
				} else{
					storedTankState=nxtTankState;
					nxtTankState=TankState.PrevATankFired;
				}
			}

			curTankState = nxtTankState;
			if (stateChanged) stateChangeCount++;
		}
		
		return isMoved;
	}

	
	public void fireATankCur(){
		if(aTankCur.getTankState()!=AntiTankState.HitTank){
			aTankCur.fireTank(this);
		} else {
			curTankState=TankState.ShotDead;
		}
	}

	public void fireATankPrev(){
		if(aTankPrev.getTankState()!=AntiTankState.Exploded){
			aTankPrev.fireTank(this);
		} else {
			curTankState=storedTankState;
		}
	}

	public void fireBothATanks(){
		if(aTankPrev.getTankState()!=AntiTankState.Exploded){
			aTankPrev.fireTank(this);
		} else {
			if(aTankCur.getTankState()!=AntiTankState.HitTank){
				aTankCur.fireTank(this);
			} else {
				curTankState=TankState.ShotDead;
			}
		}
	}
	
	public void fireTank(){
		if(tankStateTime>0){
			tankStateTime--;
		} else {
			boolean stateChanged=false;
			if(curTankBullet.getCurBulletState()==BulletState.Exploded){
				curTankBullet.resetBullet();
				curTankState=TankState.Moving;
			} else {
				
				if(curTankBullet.getCurBulletState()==BulletState.Fired){
					tankStateTime=3;
					curTankState=TankState.Firing;
					curTankBullet.createBullet(new Point(curTankPos.x,curTankPos.y),curTankDirection);
				} else {
					curTankBullet.createBullet();
				}
				
				Point curBltPos = curTankBullet.getCurBulletPos();
				Point nxtBltPos = Utils.getNextPosition(curBltPos,curTankBullet.getCurBulletDirection());
				PlayObjects nxtPosObj= PlayObjects.OutOfBounds;
				if(Utils.positionWithinBounds(nxtBltPos)) nxtPosObj=lvlPlayField[nxtBltPos.x][nxtBltPos.y];
				PlayObjects curPosObj=lvlPlayField[curBltPos.x][curBltPos.y];
				PlayObjects curPosBaseObj=lvlBaseField[curBltPos.x][curBltPos.y];
				BulletState curBulletState = curTankBullet.getCurBulletState();
				Direction curBulletDirection = curTankBullet.getCurBulletDirection();
				switch (curBulletState) {
					case MoveBlock:case MoveMirror:case MoveTank:
						boolean isMoved=false;
						switch (nxtPosObj) {
							case Ground:case Bridge:case Stream_D:case Stream_L:case Stream_R:case Stream_U:
								lvlPlayField[nxtBltPos.x][nxtBltPos.y]=curPosObj;
								curTankBullet.setCurBulletState(BulletState.Exploded);
								isMoved=true;
								break;
							case Water:
								if (curBulletState==BulletState.MoveBlock){
									lvlBaseField[nxtBltPos.x][nxtBltPos.y]=PlayObjects.Bridge;
									lvlPlayField[nxtBltPos.x][nxtBltPos.y]=PlayObjects.Bridge;
								} 
								curTankBullet.setCurBulletState(BulletState.Exploded);
								isMoved=true;
								break;
							case Tunnel_0:case Tunnel_1:case Tunnel_2:case Tunnel_3:case Tunnel_4:case Tunnel_5:case Tunnel_6:case Tunnel_7:
								nxtBltPos = getTargetTunnelLocation(nxtPosObj, nxtBltPos);
								lvlPlayField[curBltPos.x][curBltPos.y]=curPosBaseObj;
								lvlPlayField[nxtBltPos.x][nxtBltPos.y]=curPosObj;
								curTankBullet.setCurBulletState(BulletState.Exploded);
								isMoved=true;
								break;
							default:
								curTankBullet.setCurBulletState(BulletState.Exploded);
								break;
						}
						if(isMoved){
							stateChanged=true;
							if(curPosObj==curPosBaseObj) {
								lvlBaseField[curBltPos.x][curBltPos.y]=PlayObjects.Ground;
								lvlPlayField[curBltPos.x][curBltPos.y]=PlayObjects.Ground;
							} else {
								lvlPlayField[curBltPos.x][curBltPos.y]=curPosBaseObj;
							}
						}
						break;
					case HitRMirror:
						stateChanged=true;
						lvlPlayField[curBltPos.x][curBltPos.y]=getRotatedMirror(curPosObj);
						curTankBullet.setCurBulletState(BulletState.Exploded);
						break;
					case HitBrick:
						stateChanged=true;
						lvlBaseField[curBltPos.x][curBltPos.y]=PlayObjects.Ground;
						lvlPlayField[curBltPos.x][curBltPos.y]=PlayObjects.Ground;
						curTankBullet.setCurBulletState(BulletState.Exploded);
						break;
					case HitSteel:case HitDTank:
						curTankBullet.setCurBulletState(BulletState.Exploded);
						break;
					case HitTank:
						stateChanged=true;
						lvlPlayField[curBltPos.x][curBltPos.y]=Utils.destroyTank(curPosObj);
						curTankBullet.setCurBulletState(BulletState.Exploded);
						break;
					case EnterMMirror:
						curTankBullet.setCurBulletDirection(getMirrorReflectDirecion(curPosObj, curBulletDirection));
						nxtBltPos=curBltPos;
						curTankBullet.setCurBulletState(BulletState.ExitMMirror);
						break;
					case EnterRMirror:
						curTankBullet.setCurBulletDirection(getMirrorReflectDirecion(curPosObj, curBulletDirection));
						nxtBltPos=curBltPos;
						curTankBullet.setCurBulletState(BulletState.ExitRMirror);
						break;
					case InMotion:case ExitMMirror:case Fired:case ExitRMirror:case PassCrystal:
						switch (nxtPosObj) {
							case DTank_D:case DTank_L:case DTank_R:case DTank_U:
								curTankBullet.setCurBulletState(BulletState.HitDTank);
								break;
							case ATank_U:
								if(curBulletDirection==Direction.Down)
									curTankBullet.setCurBulletState(BulletState.HitTank);
								else
									curTankBullet.setCurBulletState(BulletState.MoveTank);
								break;
							case ATank_R:
								if(curBulletDirection==Direction.Left)
									curTankBullet.setCurBulletState(BulletState.HitTank);
								else
									curTankBullet.setCurBulletState(BulletState.MoveTank);
								break;
							case ATank_D:
								if(curBulletDirection==Direction.Up)
									curTankBullet.setCurBulletState(BulletState.HitTank);
								else
									curTankBullet.setCurBulletState(BulletState.MoveTank);
								break;
							case ATank_L:
								if(curBulletDirection==Direction.Right)
									curTankBullet.setCurBulletState(BulletState.HitTank);
								else
									curTankBullet.setCurBulletState(BulletState.MoveTank);
								break;
							case Brick:
								curTankBullet.setCurBulletState(BulletState.HitBrick);
								break;
							case Crystal:
								curTankBullet.setCurBulletState(BulletState.PassCrystal);
								break;
							case MBlock:
								curTankBullet.setCurBulletState(BulletState.MoveBlock);
								break;
							case MMirror_D:
								if(curBulletDirection==Direction.Right||curBulletDirection==Direction.Down)
									curTankBullet.setCurBulletState(BulletState.MoveMirror);
								else
									curTankBullet.setCurBulletState(BulletState.EnterMMirror);
								break;
							case MMirror_L:
								if(curBulletDirection==Direction.Left||curBulletDirection==Direction.Down)
									curTankBullet.setCurBulletState(BulletState.MoveMirror);
								else
									curTankBullet.setCurBulletState(BulletState.EnterMMirror);
								break;
							case MMirror_R:
								if(curBulletDirection==Direction.Right||curBulletDirection==Direction.Up)
									curTankBullet.setCurBulletState(BulletState.MoveMirror);
								else
									curTankBullet.setCurBulletState(BulletState.EnterMMirror);
								break;
							case MMirror_U:
								if(curBulletDirection==Direction.Left||curBulletDirection==Direction.Up)
									curTankBullet.setCurBulletState(BulletState.MoveMirror);
								else
									curTankBullet.setCurBulletState(BulletState.EnterMMirror);
								break;
							case RMirror_D:
								if(curBulletDirection==Direction.Right||curBulletDirection==Direction.Down)
									curTankBullet.setCurBulletState(BulletState.HitRMirror);
								else
									curTankBullet.setCurBulletState(BulletState.EnterRMirror);
								break;
							case RMirror_L:
								if(curBulletDirection==Direction.Left||curBulletDirection==Direction.Down)
									curTankBullet.setCurBulletState(BulletState.HitRMirror);
								else
									curTankBullet.setCurBulletState(BulletState.EnterRMirror);
								break;
							case RMirror_R:
								if(curBulletDirection==Direction.Right||curBulletDirection==Direction.Up)
									curTankBullet.setCurBulletState(BulletState.HitRMirror);
								else
									curTankBullet.setCurBulletState(BulletState.EnterRMirror);
								break;
							case RMirror_U:
								if(curBulletDirection==Direction.Left||curBulletDirection==Direction.Up)
									curTankBullet.setCurBulletState(BulletState.HitRMirror);
								else
									curTankBullet.setCurBulletState(BulletState.EnterRMirror);
								break;
							case Steel:
								curTankBullet.setCurBulletState(BulletState.HitSteel);
								break;
							case OutOfBounds:
								curTankBullet.setCurBulletState(BulletState.Exploded);
								break;
							default:
								curTankBullet.setCurBulletState(BulletState.InMotion);
								break;
						}
						
						switch (curTankBullet.getCurBulletState()) {
							case HitSteel:case MoveMirror:case MoveBlock:case HitBrick:case HitTank: case MoveTank:
								GameSounds.BlastSound.play();
								break;
							case HitRMirror:case EnterRMirror:case EnterMMirror:
								GameSounds.ShootSound.play();
								break;
						}
						break;
				}
				curTankBullet.setCurBulletPos(nxtBltPos);
			}
			if(stateChanged){
				stateChangeCount++;
				if(isPosOnFire(aTankCur, curTankPos)){
					curTankState=TankState.CurATankFired;
				}
			}
		}
	}
	
	public Point getTargetTunnelLocation(PlayObjects tunnelObj, Point curPoint){
		Point nxtPoint = curPoint;
		for (int i = 0; i < GlobalVars.lvlFieldLen.x; i++) {
			for (int j = 0; j < GlobalVars.lvlFieldLen.y; j++) {
				if(lvlPlayField[i][j]==tunnelObj){
					Point tmpPoint=new Point(i,j);
					if(!tmpPoint.equals(curPoint)){
						nxtPoint=tmpPoint;
						return nxtPoint;
					}
				}
			}
		}
		return nxtPoint;
	}
	
	public boolean isPosOnFire(ATank aTank, Point curPos) {
		boolean onFire = false;
		int tankRightLen = 100;
		int tankLeftLen = 100;
		int tankDownLen = 100;
		int tankUpLen = 100;
		int tempLen = 1;
		int x = 0, y = 0;

		for (x = curPos.x + 1, tempLen = 1; x < GlobalVars.lvlFieldLen.x; x++, tempLen++) {
			PlayObjects curObj = lvlPlayField[x][curPos.y];
			FirePathState curPathState = checkPathPosition(curObj, Direction.Right);
			if (curPathState == FirePathState.ATankFound) {
				tankRightLen = tempLen;
				onFire = true;
				break;
			} else if (curPathState == FirePathState.Blocked) {
				break;
			}
		}
		for (x = curPos.x - 1, tempLen = 1; x >= 0; x--, tempLen++) {
			PlayObjects curObj = lvlPlayField[x][curPos.y];
			FirePathState curPathState = checkPathPosition(curObj, Direction.Left);
			if (curPathState == FirePathState.ATankFound) {
				tankLeftLen = tempLen;
				onFire = true;
				break;
			} else if (curPathState == FirePathState.Blocked) {
				break;
			}
		}
		for (y = curPos.y + 1, tempLen = 1; y < GlobalVars.lvlFieldLen.y; y++, tempLen++) {
			PlayObjects curObj = lvlPlayField[curPos.x][y];
			FirePathState curPathState = checkPathPosition(curObj, Direction.Down);
			if (curPathState == FirePathState.ATankFound) {
				tankDownLen = tempLen;
				onFire = true;
				break;
			} else if (curPathState == FirePathState.Blocked) {
				break;
			}
		}
		for (y = curPos.y - 1, tempLen = 1; y >= 0; y--, tempLen++) {
			PlayObjects curObj = lvlPlayField[curPos.x][y];
			FirePathState curPathState = checkPathPosition(curObj, Direction.Up);
			if (curPathState == FirePathState.ATankFound) {
				tankUpLen = tempLen;
				onFire = true;
				break;
			} else if (curPathState == FirePathState.Blocked) {
				break;
			}
		}
		if (onFire) {
			if (tankRightLen < tankLeftLen && tankRightLen < tankDownLen && tankRightLen < tankUpLen) {
				aTank.setTankPos(new Point(curPos.x + tankRightLen, curPos.y));
				aTank.setTankDirection(Direction.Left);
			} else if (tankLeftLen < tankDownLen && tankLeftLen < tankUpLen) {
				aTank.setTankPos(new Point(curPos.x - tankLeftLen, curPos.y));
				aTank.setTankDirection(Direction.Right);
			} else if (tankDownLen < tankUpLen) {
				aTank.setTankPos(new Point(curPos.x, curPos.y + tankDownLen));
				aTank.setTankDirection(Direction.Up);
			} else {
				aTank.setTankPos(new Point(curPos.x, curPos.y - tankUpLen));
				aTank.setTankDirection(Direction.Down);
			}
			aTank.setTankState(AntiTankState.Fired);
		}
		return onFire;
	}
	
	public FirePathState checkPathPosition(PlayObjects curObj, Direction curDirection){
		FirePathState newState = FirePathState.Blocked;
		
		switch (curObj) {
			case Bridge:case Ground:case Ice:case ThinIce:case Water:case Stream_D: case Stream_L:case Stream_R: case Stream_U:
				newState = FirePathState.Clear;
				break;
			case ATank_D:
				if(curDirection==Direction.Up) newState=FirePathState.ATankFound;
				else newState=FirePathState.Blocked;
				break;
			case ATank_R:
				if(curDirection==Direction.Left) newState=FirePathState.ATankFound;
				else newState=FirePathState.Blocked;
				break;
			case ATank_U:
				if(curDirection==Direction.Down) newState=FirePathState.ATankFound;
				else newState=FirePathState.Blocked;
				break;
			case ATank_L:
				if(curDirection==Direction.Right) newState=FirePathState.ATankFound;
				else newState=FirePathState.Blocked;
				break;
			default:
				newState = FirePathState.Blocked;	
				break;
		}
		return newState;
	}
	
	public Direction getMirrorReflectDirecion(PlayObjects curBaseObj, Direction curBulletDirection){
		Direction newDirection=curBulletDirection;
		switch (curBulletDirection) {
			case Up:
				if(curBaseObj.name().contains("_D")) newDirection=Direction.Right;
				if(curBaseObj.name().contains("_L")) newDirection=Direction.Left;
				break;
			case Down:
				if(curBaseObj.name().contains("_R")) newDirection=Direction.Right;
				if(curBaseObj.name().contains("_U")) newDirection=Direction.Left;
				break;
			case Left:
				if(curBaseObj.name().contains("_D")) newDirection=Direction.Down;
				if(curBaseObj.name().contains("_R")) newDirection=Direction.Up;
				break;
			case Right:
				if(curBaseObj.name().contains("_U")) newDirection=Direction.Up;
				if(curBaseObj.name().contains("_L")) newDirection=Direction.Down;
				break;
		}
		return newDirection;
	}
	
	public PlayObjects getRotatedMirror(PlayObjects curRMirror){
		PlayObjects newRMirror = null;
		switch (curRMirror) {
			case RMirror_U:newRMirror=PlayObjects.RMirror_R;break;
			case RMirror_D:newRMirror=PlayObjects.RMirror_L;break;
			case RMirror_L:newRMirror=PlayObjects.RMirror_U;break;
			case RMirror_R:newRMirror=PlayObjects.RMirror_D;break;
		}
		return newRMirror;
	}
	
	public void incrementTankMoves(){
		tankMoves++;
	}
	
	public void incrementTankShots(){
		tankShots++;
	}

	public PlayObjects[][] getLvlBaseField() {
		return lvlBaseField;
	}

	public void setLvlBaseField(PlayObjects[][] lvlBaseField) {
		this.lvlBaseField = lvlBaseField;
	}

	public PlayObjects[][] getLvlPlayField() {
		return lvlPlayField;
	}

	public void setLvlPlayField(PlayObjects[][] lvlPlayField) {
		this.lvlPlayField = lvlPlayField;
	}

	public Direction getCurTankDirection() {
		return curTankDirection;
	}

	public void setCurTankDirection(Direction curTankDirection) {
		this.curTankDirection = curTankDirection;
	}

	public TankState getCurTankState() {
		return curTankState;
	}

	public void setCurTankState(TankState curTankState) {
		this.curTankState = curTankState;
	}

	public int getTankMoves() {
		return tankMoves;
	}

	public void setTankMoves(int tankMoves) {
		this.tankMoves = tankMoves;
	}

	public Point getCurTankPos() {
		return curTankPos;
	}

	public void setCurTankPos(Point curTankPos) {
		this.curTankPos = curTankPos;
	}

	public Bullet getCurTankBullet() {
		return curTankBullet;
	}

	public void setCurTankBullet(Bullet curTankBullet) {
		this.curTankBullet = curTankBullet;
	}

	public ATank getaTankPrev() {
		return aTankPrev;
	}

	public void setaTankPrev(ATank aTankPrev) {
		this.aTankPrev = aTankPrev;
	}

	public ATank getaTankCur() {
		return aTankCur;
	}

	public void setaTankCur(ATank aTankCur) {
		this.aTankCur = aTankCur;
	}

	public int getStateChangeCount() {
		return stateChangeCount;
	}

	public void setStateChangeCount(int stateChangeCount) {
		this.stateChangeCount = stateChangeCount;
	}

	public int getTankShots() {
		return tankShots;
	}

	public void setTankShots(int tankShots) {
		this.tankShots = tankShots;
	}

}
